package localedate01;

import java.time.LocalDate;

/*
  LocalDate类
     它里面封装的只有年月日，而且默认格式为年-月-日
   获取功能：
        static LocalDate now()

        public int getYear()

        Month getMonth()

        int getDayOfYear()

 */
public class LocalDateDemo01 {
    public static void main(String[] args) {
        //method01();

        LocalDate now = LocalDate.now();
        System.out.println(now);

        int year = now.getYear();
        System.out.println(year);
        System.out.println(now.getMonth());
        System.out.println(now.getDayOfMonth());

    }

    private static void method01() {
        LocalDate now = LocalDate.now();//获取当前的年月日
        System.out.println(now);  //2023-11-02
    }
}
